﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace WCS.Entities
{
    /// <summary>
    /// 公共设施类
    /// 充电桩
    /// 停车点
    /// 以及无动力货架等
    /// </summary>
    public abstract class Facilities
    {
        #region Property

        [SugarColumn(IsPrimaryKey = true)]
        /// <summary>
        /// Id 编号
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 设施名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool Enable { get; set; } = true;

        /// <summary>
        /// 所在区域
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Region { get; set; }

        /// <summary>
        /// X坐标
        /// </summary>
        public float XPosition { get; set; }  //X坐标

        /// <summary>
        /// Y坐标
        /// </summary>
        public float YPosition { get; set; } //Y坐标

        #endregion

        #region Override
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return false;
            }
            if (ReferenceEquals(obj, this))
            {
                return true;
            }
            if (obj.GetType() != GetType())
            {
                return false;
            }
            return obj is Facilities b && Id == (obj as Facilities).Id;
        }

        public override int GetHashCode()
        {
            return Id.GetHashCode();
        }



        #endregion
    }
}
